<template>
  <div class="box">
      <header class="header">首页</header>
      <div class="content">
        <ul>
          <li v-for="item of bannerList" :key="item.bannerid">
            <img :src="item.img" alt="">
          </li>
        </ul>
        <ul>
          <li v-for="item of proList" :key="item.proid">
            {{ item.proname }}
          </li>
        </ul>
      </div>
    </div>
</template>
<script>
export default {
  mounted () {
    console.log(this)
    this.$store.dispatch({
      type: 'home/getBannerListAction'
    })
    this.$store.dispatch('home/getProListAction')
  },
  computed: {
    bannerList () {
      return this.$store.state.home.bannerList
    },
    proList () {
      return this.$store.state.home.proList
    }
  }
}
</script>
